home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / graphEditorPanel.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  37.5 KB  |  1,216 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. //  Alias|Wavefront Script File
  19. //  MODIFY THIS AT YOUR OWN RISK
  20. //
  21. //  Creation Date:  June 26, 1996
  22. //  Author:         mm
  23. //
  24. //  Description:
  25. //      This script a panel which has both an outliner and a graph editor
  26. //    within it.
  27. //
  28. //  Input Arguments:
  29. //      None.
  30. //
  31. //  Return Value:
  32. //      None.
  33. //
  34.  
  35. proc setOptionVars ()
  36. {
  37.     // autoFit
  38.     if (!`optionVar -exists graphEditorAutoFit`) {
  39.         optionVar -intValue graphEditorAutoFit 0;
  40.     }
  41.  
  42.     //    clipTime
  43.     if (!`optionVar -exists graphEditorClipTime`) {
  44.         optionVar -intValue graphEditorClipTime 0;
  45.     }
  46. }
  47.  
  48. // *********************************************
  49. // Start of all menu creation procedures
  50. // *********************************************
  51.  
  52. global proc buildGraphEdViewMenu (string $graphEd, string $parentMenu)
  53. //
  54. //  Procedure Name:
  55. //      GraphEdViewMenu
  56. //
  57. //  Description:
  58. //        This creates submenu items for view
  59. //        functionality in the graph editor.
  60. //
  61. //  Input Arguments:
  62. //      None.
  63. //
  64. //  Return Value:
  65. //      None.
  66. //
  67. {
  68.     setParent -menu $parentMenu;
  69.     // Check to see if we have to build the menu items
  70.     //
  71.     if (`menu -query -numberOfItems $parentMenu` == 0) {
  72.         menuItem -label "Clip Time"
  73.             -checkBox false
  74.             -annotation ("Clip Time: Display clip curves in their Trax location rather than their originally keyed location.")
  75.             -command (
  76.                 "animCurveEditor -edit -clipTime #1 " + $graphEd + ";" +
  77.                 "optionVar -intValue graphEditorClipTime #1;"
  78.             )
  79.             clipTimeItem;
  80.  
  81.         menuItem -divider true;
  82.  
  83.         menuItem -label "Frame All"
  84.             -annotation "Frame All Curves"
  85.             -command ("FrameAll");
  86.         menuItem -label "Frame Selection"
  87.             -annotation "Frame Selected Curves"            
  88.             -command ("FrameSelected");
  89.         menuItem -label "Frame Playback Range"
  90.             -annotation "Frame the Playback Range"
  91.             -command (
  92.                 "animView " +
  93.                 "-startTime (`playbackOptions -query -minTime` - 1) " +
  94.                 "-endTime (`playbackOptions -query -maxTime` + 1) " +
  95.                  $graphEd
  96.             );
  97.         menuItem -label "Center Current Time"
  98.             -annotation "Center the view about the current time"
  99.             -command ("animCurveEditor -edit -lookAt currentTime " + $graphEd);
  100.  
  101.         menuItem -divider true;
  102.  
  103.         menuItem -label "Auto Frame"
  104.             -checkBox false
  105.             -annotation "Auto Frame: As selection changes, reframe the selected curves."
  106.             -command (
  107.                 "animCurveEditor -edit -autoFit #1 " + $graphEd + ";" +
  108.                 "optionVar -intValue graphEditorAutoFit #1;"
  109.             )
  110.             displayAutoFitItem;
  111.  
  112.         menuItem -label "Show Results"
  113.             -checkBox false
  114.             -annotation "Show Results: Display a graphic representation of an expression or other non-keyed action."
  115.             -command ("if (#1) performShowResults 0 " + $graphEd + "; else animCurveEditor -edit -showResults #1 " + $graphEd + ";")
  116.             showResultsItem;
  117.         menuItem -optionBox true 
  118.             -label "Show Results Option Box"
  119.             -command ("performShowResults 1 " + $graphEd) 
  120.             showResultsOptionsItem;
  121.         menuItem -label "Show Buffer Curves"
  122.             -checkBox false
  123.             -annotation "Show Buffer Curves: Display the original shape of edited curves."
  124.             -command ("animCurveEditor -edit -showBufferCurves #1 " + $graphEd)
  125.             showBuffersItem;
  126.  
  127.         menuItem -divider true;
  128.  
  129.         menuItem -label "Keys" -subMenu true -tearOff true
  130.             displayKeyframeMenu;
  131.  
  132.             radioMenuItemCollection;
  133.             menuItem -label "Always"
  134.                 -annotation "Keys: Always display keys"
  135.                 -radioButton 1    displayKeyAlwaysItem;
  136.             menuItem -label "Never"
  137.                 -annotation "Keys: Never display keys"
  138.                 -radioButton 0 displayKeyNeverItem;
  139.             menuItem -label "Active Only"
  140.                 -annotation "Keys: Only display keys on active curves."
  141.                 -radioButton 0 displayKeyActiveItem;
  142.  
  143.             setParent -m ..;
  144.  
  145.         string $tangentMenu = `menuItem -label "Tangents" -subMenu true 
  146.             -tearOff true displayTangentMenu`; 
  147.  
  148.             radioMenuItemCollection;
  149.             menuItem -label "Always"
  150.                 -radioButton 1
  151.                 -annotation "Tangents: Always Display"
  152.                 -command ("animCurveEditor -edit -displayTangents true " + 
  153.                           "-displayActiveKeyTangents false " + $graphEd) 
  154.                 displayTangentAlwaysItem;
  155.             menuItem -label "Never"
  156.                 -radioButton 0
  157.                 -annotation "Tangents: Never Display"                
  158.                 -command ("animCurveEditor -edit -displayTangents false " + 
  159.                           "-displayActiveKeyTangents false " + $graphEd) 
  160.                 displayTangentNeverItem;
  161.             menuItem -label "On Active Keys"
  162.                 -radioButton 0
  163.                 -annotation "Tangents: Only display tangents on active curves."
  164.                 -command ("animCurveEditor -edit -displayTangents false " + 
  165.                           "-displayActiveKeyTangents true " + $graphEd) 
  166.                 displayTangentActiveItem;
  167.  
  168.             setParent -m ..;
  169.  
  170.         // Now that we know the name of the Tangent Menu, we can
  171.         // disable it when we're not showing keyframes
  172.         //
  173.         menuItem -e 
  174.             -command ("menuItem -e -enable true " + $tangentMenu + "; " +
  175.                       "animCurveEditor -edit -displayKeys true " + 
  176.                       "-displayActiveKeys false " + $graphEd) 
  177.             displayKeyAlwaysItem;
  178.  
  179.         menuItem -e 
  180.             -command ("menuItem -e -enable false " + $tangentMenu + "; " +
  181.                       "animCurveEditor -edit -displayKeys false " + 
  182.                       "-displayActiveKeys false " + $graphEd) 
  183.             displayKeyNeverItem;
  184.  
  185.         menuItem -e 
  186.             -command ("menuItem -e -enable true " + $tangentMenu + "; " +
  187.                       "animCurveEditor -edit -displayKeys false " + 
  188.                       "-displayActiveKeys true " + $graphEd) 
  189.             displayKeyActiveItem;
  190.  
  191.         menuItem -label "Infinity"
  192.             -checkBox false
  193.             -annotation "Infinities: Display Infinities"
  194.             -command ("animCurveEditor -edit -displayInfinities #1 " + $graphEd) 
  195.             displayInfinityItem;
  196.     }
  197.  
  198.     int $clipTimeOptVar = `optionVar -q graphEditorClipTime`;
  199.     int $graphEdClipTimeState = 
  200.         (`animCurveEditor -q -clipTime $graphEd` == "on" ? 1 : 0);
  201.     menuItem -edit
  202.         -checkBox $clipTimeOptVar
  203.         clipTimeItem;
  204.  
  205.     if ($clipTimeOptVar != $graphEdClipTimeState) {
  206.         animCurveEditor -e -clipTime $clipTimeOptVar $graphEd;
  207.     }
  208.  
  209.     menuItem -edit
  210.         -checkBox `animCurveEditor -query -autoFit $graphEd`
  211.         displayAutoFitItem;
  212.  
  213.     string $result = `animCurveEditor -query -showResults $graphEd`;
  214.     menuItem -edit
  215.         -checkBox ($result == "on" ? 1 : 0)
  216.         showResultsItem;
  217.  
  218.     $result = `animCurveEditor -query -showBufferCurves $graphEd`;
  219.     menuItem -edit
  220.         -checkBox ($result == "on" ? 1 : 0)
  221.         showBuffersItem;
  222.  
  223.     // Disable if can't show keyframes
  224.     //
  225.  
  226.     menuItem -edit -enable (`animCurveEditor -q -displayKeys $graphEd` ||
  227.                             `animCurveEditor -q -displayActiveKeys $graphEd`)
  228.         displayTangentMenu;
  229.  
  230.     // Make sure the right radio button is pressed: Keyframe menu
  231.     //
  232.     if( `animCurveEditor -query -displayActiveKeys $graphEd` == 1 ) {
  233.         menuItem -edit -radioButton off displayKeyAlwaysItem;
  234.         menuItem -edit -radioButton on  displayKeyActiveItem;
  235.         menuItem -edit -radioButton off displayKeyNeverItem;
  236.     } else if( `animCurveEditor -query -displayKeys $graphEd` == 1 ) {
  237.         menuItem -edit -radioButton on  displayKeyAlwaysItem;
  238.         menuItem -edit -radioButton off displayKeyActiveItem;
  239.         menuItem -edit -radioButton off displayKeyNeverItem;
  240.     } else {
  241.         menuItem -edit -radioButton off displayKeyAlwaysItem;
  242.         menuItem -edit -radioButton off displayKeyActiveItem;
  243.         menuItem -edit -radioButton on  displayKeyNeverItem;
  244.     }
  245.  
  246.     // Make sure the right radio button is pressed: Tangent menu
  247.     //
  248.     if( `animCurveEditor -query -displayActiveKeyTangents $graphEd` == 1 ) {
  249.         menuItem -edit -radioButton off displayTangentAlwaysItem;
  250.         menuItem -edit -radioButton on  displayTangentActiveItem;
  251.         menuItem -edit -radioButton off displayTangentNeverItem;
  252.     } else if( `animCurveEditor -query -displayTangents $graphEd` == 1 ) {
  253.         menuItem -edit -radioButton on  displayTangentAlwaysItem;
  254.         menuItem -edit -radioButton off displayTangentActiveItem;
  255.         menuItem -edit -radioButton off displayTangentNeverItem;
  256.     } else {
  257.         menuItem -edit -radioButton off displayTangentAlwaysItem;
  258.         menuItem -edit -radioButton off displayTangentActiveItem;
  259.         menuItem -edit -radioButton on  displayTangentNeverItem;
  260.     }
  261.  
  262.     menuItem -edit
  263.         -checkBox `animCurveEditor -query -displayInfinities $graphEd`
  264.         displayInfinityItem;
  265. }
  266.  
  267. global proc graphSnap (string $state, string $graphEd)
  268. //
  269. // Sets the snapping state for the graph editor
  270. //
  271. {
  272.     switch ($state) {
  273.     case "none":
  274.         animCurveEditor -edit -snapTime "none" $graphEd;    
  275.         animCurveEditor -edit -snapValue "none" $graphEd;    
  276.         break;
  277.     case "time":
  278.         animCurveEditor -edit -snapTime "integer" $graphEd;    
  279.         animCurveEditor -edit -snapValue "none" $graphEd;    
  280.         break;
  281.     case "value":
  282.         animCurveEditor -edit -snapTime "none" $graphEd;    
  283.         animCurveEditor -edit -snapValue "integer" $graphEd;    
  284.         break;
  285.     case "both":
  286.         animCurveEditor -edit -snapTime "integer" $graphEd;    
  287.         animCurveEditor -edit -snapValue "integer" $graphEd;    
  288.         break;
  289.     }
  290. }
  291.  
  292. global proc doBuffer (string $options)
  293. //
  294. //    Procedure Name:
  295. //        doBuffer
  296. //
  297. //    Description:
  298. //        This proc handles the buffer curve buttons.
  299. //
  300. //  Input Arguments:
  301. //        string $options            Options for this proc
  302. //            Current options:
  303. //                snapshot        Create a buffer curve
  304. //                swap            Swap buffer curves
  305. //
  306. //  Return Value:
  307. //      None.
  308. //
  309. {
  310.     int $keys = 0;
  311.     $keys = `keyframe -selected -query -keyframeCount`;
  312.     switch ($options) {
  313.     case "snapshot":
  314.         if ($keys == 0) {
  315.             warning ("No keys selected to create buffer curve(s)");
  316.         }
  317.         else {
  318.             bufferCurve -animation keys -overwrite true;
  319.         }
  320.         break;
  321.     case "swap":
  322.         if ($keys == 0) {
  323.             warning ("No keys selected to swap buffer curve(s)");
  324.         }
  325.         else {
  326.             bufferCurve -animation keys -swap;
  327.         }
  328.         break;
  329.     }
  330. }
  331.  
  332. global proc updateGraphEdSelectMenu( string $parent ) 
  333. //
  334. // Description:
  335. //    Make sure all the check boxes are properly ticked
  336. //    
  337. {
  338.     setParent -m $parent;
  339.     menuItem -e -cb `selectType -q -animCurve` selCurveItem;
  340.     menuItem -e -cb `selectType -q -animKeyframe` selKeyframeItem;
  341.     menuItem -e -cb `selectType -q -animInTangent` selInTanItem;
  342.     menuItem -e -cb `selectType -q -animOutTangent`    selOutTanItem;
  343. }
  344.  
  345. global proc buildGraphEdSelectMenu()
  346. //
  347. //  Procedure Name:
  348. //      GraphEdOptionsMenu
  349. //
  350. //  Description:
  351. //        This proc creates menu entries
  352. //        that control certain editing operations
  353. //        in the graph editor.
  354. //
  355. //  Input Arguments:
  356. //      None.
  357. //
  358. //  Return Value:
  359. //      None.
  360. //
  361. {
  362.     menuItem -label "All"
  363.         -annotation ("All: Enable selection of curves, keys, and tangents.")
  364.         -c ("selectType -animCurve true -animKeyframe true -animBreakdown true " +
  365.             "-animInTangent true -animOutTangent true") selAnyItem;
  366.     menuItem -label "Only Curve"
  367.         -annotation ("All: Enable selection of curves only.")
  368.         -c ("selectType -animCurve true -animKeyframe false -animBreakdown false " +
  369.             "-animInTangent false -animOutTangent false") selOnlyCurve;
  370.  
  371.     menuItem -divider true;
  372.     menuItem -label "Curve"
  373.         -annotation "Curve: Control whether curves are selectable."
  374.         -cb yes -c "selectType -animCurve #1" 
  375.         selCurveItem;
  376.     menuItem -label "Key" -cb yes
  377.         -annotation "Key: Control whether keys are selectable."        
  378.         -c "selectType -animKeyframe #1 -animBreakdown #1" 
  379.         selKeyframeItem;
  380.     menuItem -label "In Tangent"
  381.         -annotation "In Tangent: Control whether in tangents are selectable."
  382.         -cb yes -c "selectType -animInTangent #1" 
  383.         selInTanItem;
  384.     menuItem -label "Out Tangent"
  385.         -annotation "Out Tangent: Control whether out tangents are selectable."
  386.         -cb yes -c "selectType -animOutTangent #1" 
  387.         selOutTanItem;
  388. }
  389.  
  390.  
  391. global proc buildGraphEdKeysMenu(string $outlineEd, string $graphEd, string $parentMenu )
  392. //
  393. //  Procedure Name:
  394. //      buildGraphEdKeysMenu
  395. //
  396. //  Description:
  397. //        This creates menu entries that control
  398. //        tangent weight locking, and tangent breaking
  399. //        and unifying
  400. //
  401. //  Input Arguments:
  402. //      None.
  403. //
  404. //  Return Value:
  405. //      None.
  406. //
  407. {
  408.     setParent -menu $parentMenu;
  409.     if (`menu -query -numberOfItems $parentMenu` != 0) {
  410.         return;
  411.     }
  412.  
  413.     string $selectionConnection = `editor -query -selectionConnection $outlineEd`;
  414.  
  415.     menuItem -label "Break Tangents"
  416.         -annotation "Break Tangents: Select key(s)"
  417.         -command ("doKeyTangent \"-lock off\" " + $selectionConnection + " noOptions")
  418.         breakTanItem;
  419.     menuItem -label "Unify Tangents"
  420.         -annotation "Unify Tangents: Select key(s)"
  421.         -command ("doKeyTangent \"-lock on\" " + $selectionConnection + " noOptions")
  422.         unifyTanItem;
  423.  
  424.     menuItem -divider true;
  425.  
  426.     menuItem -label "Lock Tangent Weight"
  427.         -annotation "Lock Tangent Weight: Select key(s)"
  428.         -command ("doKeyTangent \"-weightLock on\" " + $selectionConnection + " noOptions")
  429.         tanWeightLockItem;
  430.     menuItem -label "Free Tangent Weight"
  431.         -annotation "Free Tangent Weight: Select key(s)"
  432.         -command ("doKeyTangent \"-weightLock off\" " + $selectionConnection + " noOptions")
  433.         tanWeightFreeItem;
  434.  
  435.     menuItem -divider true;
  436.  
  437.     menuItem -label "Convert to Key"
  438.         -annotation ("Convert to Key: Select breakdown")
  439.         -command ("doKeyEdit \"-breakdown false\" " + $selectionConnection + " noOptions")
  440.         makeKeysItem;
  441.     menuItem -label "Convert to Breakdown"
  442.         -annotation ("Convert to Breakdown: Select key")
  443.         -command ("doKeyEdit \"-breakdown true\" " + $selectionConnection + " noOptions")
  444.         makeBreakdownsItem;
  445.  
  446.     menuItem -label "Add Inbetween"
  447.         -annotation "Add an inbetween at the current time."
  448.         -command ("doKeyEdit \"\" " + $graphEd + " \"bufferCurve addInbetween\"")
  449.         addInbetweenItem;
  450.     menuItem -label "Remove Inbetween"
  451.         -annotation "Remove an inbetween at the current time."        
  452.         -command ("doKeyEdit \"\" " + $graphEd + " \"bufferCurve removeInbetween\"")
  453.         removeInbetweenItem;
  454. }
  455.  
  456. global proc GraphEditorMenu( string $graphEd, string $outlineEd, string $widgetList[])
  457. //
  458. //  Alias|Wavefront Script File
  459. //  MODIFY THIS AT YOUR OWN RISK
  460. //
  461. //  Creation Date:  June 14, 1996
  462. //  Author:         mm
  463. //
  464. //  Description:
  465. //      This script creates popup menu items for the graph editor.
  466. //
  467. //  Input Arguments:
  468. //      The graph editor that the menu will belong to.
  469. //
  470. //  Return Value:
  471. //      None.
  472. //
  473. {
  474.     // Load in the common menu elements library
  475.     //
  476.     loadAnimMenuLibrary;
  477.  
  478.     popupMenu
  479.         -ctrlModifier false
  480.         -button 3
  481.         -allowOptionBoxes false
  482.         -parent $graphEd
  483.         ($graphEd + "animCurveEditorMenu");
  484.  
  485.         string $menuItem = `menuItem -label "Edit" -allowOptionBoxes true -subMenu true -tearOff true`;
  486.             defineEditMenu $outlineEd $graphEd $menuItem "bufferCurve" ""; 
  487.         setParent -menu ..;
  488.  
  489.         string $viewItem = `menuItem -label "View"
  490.                     -allowOptionBoxes true
  491.                     -subMenu true
  492.                     -tearOff true`;
  493.         menuItem -edit
  494.             -postMenuCommand ("buildGraphEdViewMenu " + $graphEd + " " + $viewItem)
  495.             $viewItem;
  496.         setParent -menu ..;
  497.  
  498.         menuItem -divider true;
  499.  
  500.         string $selectItem = `menuItem -label "Select" -subMenu true 
  501.             -tearOff true`;
  502.         buildGraphEdSelectMenu;
  503.         menuItem -edit -postMenuCommand ("updateGraphEdSelectMenu " +
  504.                                          $selectItem ) $selectItem;
  505.         setParent -menu ..;
  506.  
  507.         menuItem -divider true;
  508.  
  509.         string $curvesItem = `menuItem -label "Curves" -allowOptionBoxes true -subMenu true -tearOff true`;
  510.             defineCurvesMenu $outlineEd $graphEd $curvesItem "bufferCurve useSmoothness" ""; 
  511.         setParent -menu ..;
  512.  
  513.         string $keysItem = `menuItem -label "Keys" -subMenu true -tearOff true`;
  514.         menuItem -edit
  515.             -postMenuCommand ("buildGraphEdKeysMenu " + $outlineEd + " " + $graphEd + " " + $keysItem)
  516.             $keysItem;
  517.         setParent -menu ..;
  518.  
  519.         string $tangentsItem = `menuItem -label "Tangents" -subMenu true -tearOff true`;
  520.             defineTangentsMenu $outlineEd $graphEd $tangentsItem "bufferCurve" ""; 
  521.         setParent -menu ..;
  522.  
  523.         menuItem -divider true;
  524.  
  525.         string $menuItem = `menuItem -label "List"
  526.             -allowOptionBoxes false
  527.             -subMenu true
  528.             -tearOff true
  529.             optionsHierItem`;
  530.             defineListMenu "noOptions" $outlineEd $graphEd $menuItem "";
  531.         setParent -m ..;
  532.     setParent -m ..;
  533.  
  534.     return;
  535. }
  536.  
  537. // *********************************************
  538. // End of menu creation procedures.
  539. // *********************************************
  540.  
  541.  
  542. global proc createGraphEditor (string $whichPanel)
  543. //
  544. //  Description:
  545. //        Define the editors that are used in this panel.  No
  546. //        controls (widgets) are created at this point.
  547. //
  548. {
  549.     //  create unique names for editors based on panel name
  550.     //
  551.     string $graphEd = ($whichPanel + "GraphEd");
  552.     string $outlineEd = ($whichPanel + "OutlineEd");
  553.     string $outlineConn = ($whichPanel + "FromOutliner");
  554.  
  555.     loadAnimPanelLibrary;
  556.     setOptionVars;
  557.  
  558.     selectionConnection $outlineConn;
  559.  
  560.     createSharedOutlinerEditor ($outlineEd);
  561.     outlinerEditor 
  562.         -edit
  563.         -unParent
  564.          -mainListConnection graphEditorList
  565.          -selectionConnection $outlineConn
  566.          -highlightConnection keyframeList
  567.         -showShapes true
  568.         -showAttributes true
  569.         -showConnected true
  570.         -showAnimCurvesOnly true
  571.         -showDagOnly false
  572.         -autoExpand true
  573.         -expandConnections true
  574.         -showCompounds false
  575.         -showNumericAttrsOnly true
  576.         -autoSelectNewObjects true
  577.         -transmitFilters true
  578.         -showSetMembers false
  579.         $outlineEd;
  580.  
  581.     selectionConnection -edit -parent $outlineEd $outlineConn;
  582.  
  583.     animCurveEditor
  584.         -unParent
  585.          -mainListConnection $outlineConn
  586.         -menu ""
  587.         -clipTime `optionVar -query graphEditorClipTime`
  588.         -autoFit `optionVar -query graphEditorAutoFit`
  589.         -displayInfinities false
  590.         $graphEd;
  591.  
  592.     registerEditor ($outlineEd, "graphEditorList");
  593. }
  594.  
  595. global proc buildGraphEditorContextHelpItems(string $nameRoot, string $menuParent)
  596. //
  597. //  Description:
  598. //        Build context sensitive menu items
  599. //        
  600. //  Input Arguments:
  601. //        $nameRoot - name to use as the root of all item names
  602. //        $menuParent - the name of the parent of this menu
  603. //
  604. //  Return Value:
  605. //      None
  606. //
  607. {
  608.     menuItem -label "Help on Graph Editor..."
  609.         -enableCommandRepeat false
  610.         -command "showHelp GraphEditor";
  611. }
  612.  
  613. global proc addGraphEditor (string $whichPanel)
  614. //
  615. //  Description:
  616. //        Add the panel to a layout.
  617. //        Parent the editors to that layout and create any other
  618. //        controls (widgets) required.
  619. //
  620. {
  621.     string $graphEd = ($whichPanel + "GraphEd");
  622.     string $outlineEd = ($whichPanel + "OutlineEd");
  623.     string $outlineEdForm = ($whichPanel + "OutlineEdForm");
  624.  
  625.     string $selectionConnection = `editor -query -selectionConnection $outlineEd`;
  626.  
  627. //    Do not use the wait cursor, it causes a problem (crash) when used
  628. //    in combination with the table widget (key frame stats). (64944)
  629. // 
  630. //    waitCursor -state on;
  631.     
  632.     // Make sure that there is no template active
  633.     setUITemplate -pushTemplate NONE;
  634.  
  635.     // Define the standard animation editing panel
  636.     //
  637.     string $widgetList[] = `definePanelElements $whichPanel`;
  638.  
  639.     //    menuBarLayout is turned on for this editor -
  640.     //    create the top level menus
  641.     //
  642.         setParent $widgetList[2];
  643.  
  644.         string $menuItem = `menu -label "Edit" 
  645.                     -allowOptionBoxes true 
  646.                     -tearOff true
  647.                     -postMenuCommandOnce true
  648.                     -familyImage "menuIconEdit.xpm"`;
  649.             defineEditMenu $outlineEd $graphEd $menuItem "bufferCurve" "";
  650.         setParent -menu ..;
  651.  
  652.         string $viewMenu = `menu -label "View"
  653.                     -allowOptionBoxes true
  654.                     -tearOff true
  655.                     -familyImage "menuIconView.xpm"`;
  656.         menu -edit
  657.             -postMenuCommand ("buildGraphEdViewMenu " + $graphEd + " " + $viewMenu)
  658.             $viewMenu;
  659.         setParent -menu ..;
  660.  
  661.         string $selectMenu = `menu -label "Select" 
  662.                     -tearOff true
  663.                     -familyImage "menuIconSelect.xpm"`;
  664.         menu -edit -postMenuCommand ("updateGraphEdSelectMenu " + $selectMenu )
  665.             $selectMenu;
  666.         buildGraphEdSelectMenu;
  667.         setParent -menu ..;
  668.  
  669.         string $curvesMenu = `menu -label "Curves" 
  670.                         -allowOptionBoxes true
  671.                         -tearOff true
  672.                         -familyImage "menuIconAnimCurves.xpm"`;
  673.             defineCurvesMenu $outlineEd $graphEd $curvesMenu "bufferCurve useSmoothness" "";
  674.         setParent -menu ..;
  675.  
  676.         string $keysMenu = `menu -label "Keys"  
  677.                     -tearOff true
  678.                     -postMenuCommandOnce true
  679.                     -familyImage "menuIconKeys.xpm"`;
  680.         menu -edit
  681.             -postMenuCommand ("buildGraphEdKeysMenu " + $outlineEd + " " + $graphEd + " " + $keysMenu)
  682.             $keysMenu;
  683.         setParent -menu ..;
  684.  
  685.         string $tangentsMenu = `menu -label "Tangents" 
  686.                         -tearOff true
  687.                         -postMenuCommandOnce true
  688.                         -familyImage "menuIconTangents.xpm"`;
  689.             defineTangentsMenu $outlineEd $graphEd $tangentsMenu "bufferCurve" "";
  690.         setParent -menu ..;
  691.  
  692.         $menuItem = `menu -label "List" 
  693.                 -tearOff true
  694.                 -familyImage "menuIconOptions.xpm"`;
  695.             defineListMenu "noOptions" $outlineEd $graphEd $menuItem "";
  696.         setParent -m ..;
  697.  
  698.         //    Attach the filter menu to the menu bar.
  699.         //
  700.         filterUICreateMenu($outlineEd, `setParent -query`);
  701.  
  702.     //    Add support for the Context Sensitive Help Menu.
  703.     //
  704.     addContextHelpProc $whichPanel "buildGraphEditorContextHelpItems";
  705.  
  706.     // Attach tools to the tool form
  707.     //
  708.     setParent $widgetList[4];
  709.         toolButton 
  710.             -doubleClickCommand toolPropertyWindow
  711.             -collection toolCluster 
  712.             -tool directKeySuperContext 
  713.             -style "iconOnly"
  714.             -image1 "directKeySmall.xpm"
  715.             -width 26 -height 26
  716.             directKeyTool;
  717.         toolButton 
  718.             -doubleClickCommand toolPropertyWindow
  719.             -collection toolCluster 
  720.             -tool insertKeySuperContext 
  721.             -style "iconOnly"
  722.             -image1 "insertKeySmall.xpm"
  723.             -width 26 -height 26
  724.             insertKeyTool;
  725.         toolButton 
  726.             -doubleClickCommand toolPropertyWindow
  727.             -collection toolCluster 
  728.             -tool setKeySuperContext 
  729.             -style "iconOnly"
  730.             -image1 "setKeySmall.xpm"
  731.             -width 26 -height 26
  732.             setKeyTool;
  733.  
  734.         // Keyframe stats window
  735.         //
  736.         keyframeStats 
  737.             -height 26 
  738.             -width 165 
  739.             -animEditor $graphEd 
  740.             -timeAnnotation "Selected Key's Time: Enter a value for the selected key's time"
  741.             -valueAnnotation "Selected Key's Value: Enter a value for the selected key"
  742.             keyframeStats;
  743.  
  744.  
  745.         //    Set initial snapping states
  746.         //
  747.         int $timeSnap = 0;
  748.         int $valueSnap = 0;
  749.  
  750.         string $snap = `animCurveEditor -query -snapTime $graphEd`;
  751.         if( $snap != "none" ) {
  752.             $timeSnap = 1;
  753.         }
  754.  
  755.         $snap = `animCurveEditor -query -snapValue $graphEd`;
  756.         if( $snap != "none" ) {
  757.             $valueSnap = 1;
  758.         }
  759.  
  760.         // Buffer curve support
  761.         //
  762.         int $iconSize = 26;
  763.  
  764.         iconTextButton 
  765.             -i1 "bufferSnap.xpm"
  766.             -width $iconSize -height $iconSize 
  767.             -command "doBuffer snapshot"
  768.             -annotation "Buffer curve snapshot; display with View->Show Buffer Curves"
  769.             bufferSnapButton;
  770.         iconTextButton 
  771.             -i1 "bufferSwap.xpm"
  772.             -width $iconSize -height $iconSize
  773.             -command "doBuffer swap"
  774.             -annotation "Swap buffer curve; display with View->Show Buffer Curves"
  775.             bufferSwapButton;
  776.  
  777.         iconTextCheckBox 
  778.             -i1 "snapTime.xpm" 
  779.             -width $iconSize -height $iconSize 
  780.             -onCommand ( "animCurveEditor -edit -snapTime \"integer\"" + $graphEd )
  781.             -offCommand ( "animCurveEditor -edit -snapTime \"none\"" + $graphEd )
  782.             -annotation "Time snap on/off"
  783.             -value $timeSnap
  784.             timeSnapButton;
  785.         iconTextCheckBox 
  786.             -i1 "snapValue.xpm" 
  787.             -width $iconSize -height $iconSize 
  788.             -onCommand ( "animCurveEditor -edit -snapValue \"integer\"" + $graphEd )
  789.             -offCommand ( "animCurveEditor -edit -snapValue \"none\"" + $graphEd )
  790.             -annotation "Value snap on/off"
  791.             -value $valueSnap
  792.             valueSnapButton;
  793.         iconTextButton 
  794.             -i1 "breakTangent.xpm"
  795.             -width $iconSize -height $iconSize 
  796.             -command ("doKeyTangent \"-lock off\" " + $selectionConnection + " noOptions")
  797.             -annotation "Break tangents"
  798.             breakTanButton;
  799.         iconTextButton 
  800.             -i1 "unifyTangent.xpm"
  801.             -width $iconSize -height $iconSize 
  802.             -command ("doKeyTangent \"-lock on\" " + $selectionConnection + " noOptions")
  803.             -annotation "Unify tangents"
  804.             unifyTanButton;
  805.         iconTextButton 
  806.             -i1 "freeTangentWeight.xpm"
  807.             -width $iconSize -height $iconSize 
  808.             -command ("doKeyTangent \"-weightLock off\" " + $selectionConnection + " noOptions")
  809.             -annotation "Free tangent weight"
  810.             freeTanButton;
  811.         iconTextButton 
  812.             -i1 "lockTangentWeight.xpm"
  813.             -width $iconSize -height $iconSize
  814.             -command ("doKeyTangent \"-weightLock on\" " + $selectionConnection + " noOptions")
  815.             -annotation "Lock tangent weight"
  816.             lockTanButton;
  817.         iconTextButton 
  818.             -i1 "splineTangent.xpm"
  819.             -width $iconSize -height $iconSize
  820.             -command ("doKeyTangent \"-itt spline -ott spline\" " + $graphEd + " bufferCurve")
  821.             -annotation "Spline tangents"
  822.             splineTanButton;
  823.         iconTextButton 
  824.             -i1 "clampedTangent.xpm"
  825.             -width $iconSize -height $iconSize
  826.             -command ("doKeyTangent \"-itt clamped -ott clamped\" " + $graphEd + " bufferCurve")
  827.             -annotation "Clamped tangents"
  828.             clampedTanButton;
  829.         iconTextButton 
  830.             -i1 "linearTangent.xpm"
  831.             -width $iconSize -height $iconSize
  832.             -command ("doKeyTangent \"-itt linear -ott linear\" " + $graphEd + " bufferCurve")
  833.             -annotation "Linear tangents"
  834.             linearTanButton;
  835.         iconTextButton 
  836.             -i1 "flatTangent.xpm"
  837.             -width $iconSize -height $iconSize
  838.             -command ("doKeyTangent \"-itt flat -ott flat\" " + $graphEd + " bufferCurve")
  839.             -annotation "Flat tangents"
  840.             flatTanButton;
  841.         iconTextButton 
  842.             -i1 "stepTangent.xpm"
  843.             -width $iconSize -height $iconSize
  844.             -command ("doKeyTangent \"-ott step\" " + $graphEd + " bufferCurve")
  845.             -annotation "Step tangents"
  846.             stepTanButton;
  847.  
  848.         // toggleAutoLoad needs to know the full path name of this button
  849.         // however it is difficult to pass it in (because toggleAutoLoad
  850.         // is called from several places, including c++ code), so instead
  851.         // the name is carefully constructed to be unique
  852.         //
  853.         string $loadToggleButton = ($outlineEd + "loadToggleButton");
  854.         string $reloadButton = ($outlineEd + "reloadButton");
  855.         iconTextCheckBox 
  856.             -i1 "autoload.xpm" 
  857.             -width $iconSize -height $iconSize 
  858.             -onCommand ( "toggleAutoLoad " + $outlineEd + " 1" )
  859.             -offCommand ( "toggleAutoLoad " + $outlineEd + " 0" )
  860.             -annotation "Auto Load Graph Editor on/off"
  861.             -value `isAutoLoad $outlineEd`
  862.             $loadToggleButton;
  863.  
  864.         iconTextButton 
  865.             -i1 "reload.xpm"
  866.             -width $iconSize -height $iconSize
  867.             -command ("doReload " + $outlineEd )
  868.             -annotation "Load Graph Editor from Selection"
  869.             -enable (!`isAutoLoad $outlineEd`)
  870.             $reloadButton;
  871.  
  872.         //    Separators, to break up layout of the
  873.         //    buttons on the graph editor toolbar
  874.         //
  875.         separator -horizontal false -style single toolSeparator;
  876.         separator -horizontal false -style single bufferSeparator;
  877.         separator -horizontal false -style single snapSeparator;
  878.         separator -horizontal false -style single tangentSeparator;
  879.         separator -horizontal false -style single interpSeparator;
  880.         separator -horizontal false -style single loadSeparator;
  881.         separator -horizontal false -style single rightSeparator;
  882.  
  883.         //    Layout the toolbar
  884.         //
  885.         int $margin = 1;
  886.         formLayout -edit
  887.             -attachForm directKeyTool "left" 0     
  888.             -attachControl insertKeyTool "left" 0 directKeyTool
  889.             -attachControl setKeyTool "left" 0 insertKeyTool
  890.  
  891.             -attachControl toolSeparator "left" $margin setKeyTool
  892.             -attachForm toolSeparator "top" $margin
  893.             -attachForm toolSeparator "bottom" $margin
  894.             -attachNone toolSeparator "right"
  895.  
  896.             -attachControl keyframeStats "left" $margin toolSeparator
  897.             -attachForm keyframeStats "top" $margin
  898.             -attachForm keyframeStats "bottom" $margin
  899.             -attachNone keyframeStats "right"
  900.  
  901.             -attachControl interpSeparator "left" $margin keyframeStats
  902.             -attachForm interpSeparator "top" $margin
  903.             -attachForm interpSeparator "bottom" $margin
  904.             -attachNone interpSeparator "right"
  905.  
  906.             -attachControl splineTanButton "left" 0 interpSeparator
  907.             -attachForm splineTanButton "top" $margin
  908.             -attachForm splineTanButton "bottom" $margin
  909.             -attachNone splineTanButton "right"
  910.  
  911.             -attachControl clampedTanButton "left" 0 splineTanButton
  912.             -attachForm clampedTanButton "top" $margin
  913.             -attachForm clampedTanButton "bottom" $margin
  914.             -attachNone clampedTanButton "right"
  915.  
  916.             -attachControl linearTanButton "left" 0 clampedTanButton
  917.             -attachForm linearTanButton "top" $margin
  918.             -attachForm linearTanButton "bottom" $margin
  919.             -attachNone linearTanButton "right"
  920.  
  921.             -attachControl flatTanButton "left" 0 linearTanButton
  922.             -attachForm flatTanButton "top" $margin
  923.             -attachForm flatTanButton "bottom" $margin
  924.             -attachNone flatTanButton "right"
  925.  
  926.             -attachControl stepTanButton "left" 0 flatTanButton
  927.             -attachForm stepTanButton "top" $margin
  928.             -attachForm stepTanButton "bottom" $margin
  929.             -attachNone stepTanButton "right"
  930.  
  931.             -attachControl bufferSeparator "left" $margin stepTanButton
  932.             -attachForm bufferSeparator "top" $margin
  933.             -attachForm bufferSeparator "bottom" $margin
  934.             -attachNone bufferSeparator "right"
  935.  
  936.             -attachControl bufferSnapButton "left" $margin bufferSeparator
  937.             -attachForm bufferSnapButton "top" $margin
  938.             -attachForm bufferSnapButton "bottom" $margin
  939.             -attachNone bufferSnapButton "right"
  940.  
  941.             -attachControl bufferSwapButton "left" 0 bufferSnapButton
  942.             -attachForm bufferSwapButton "top" $margin
  943.             -attachForm bufferSwapButton "bottom" $margin
  944.             -attachNone bufferSwapButton "right"
  945.  
  946.             -attachControl tangentSeparator "left" $margin bufferSwapButton
  947.             -attachForm tangentSeparator "top" $margin
  948.             -attachForm tangentSeparator "bottom" $margin
  949.             -attachNone tangentSeparator "right"
  950.  
  951.             -attachControl breakTanButton "left" $margin tangentSeparator
  952.             -attachForm breakTanButton "top" $margin
  953.             -attachForm breakTanButton "bottom" $margin
  954.             -attachNone breakTanButton "right"
  955.  
  956.             -attachControl unifyTanButton "left" 0 breakTanButton
  957.             -attachForm unifyTanButton "top" $margin
  958.             -attachForm unifyTanButton "bottom" $margin
  959.             -attachNone unifyTanButton "right"
  960.  
  961.             -attachControl freeTanButton "left" 0 unifyTanButton
  962.             -attachForm freeTanButton "top" $margin
  963.             -attachForm freeTanButton "bottom" $margin
  964.             -attachNone freeTanButton "right"
  965.  
  966.             -attachControl lockTanButton "left" 0 freeTanButton
  967.             -attachForm lockTanButton "top" $margin
  968.             -attachForm lockTanButton "bottom" $margin
  969.             -attachNone lockTanButton "right"
  970.  
  971.             -attachControl loadSeparator "left" $margin lockTanButton
  972.             -attachForm loadSeparator "top" $margin
  973.             -attachForm loadSeparator "bottom" $margin
  974.             -attachNone loadSeparator "right"
  975.  
  976.             -attachControl $loadToggleButton "left" $margin loadSeparator
  977.             -attachForm $loadToggleButton "top" $margin
  978.             -attachForm $loadToggleButton "bottom" $margin
  979.             -attachNone $loadToggleButton "right"
  980.  
  981.             -attachControl $reloadButton "left" 0 $loadToggleButton
  982.             -attachForm $reloadButton "top" $margin
  983.             -attachForm $reloadButton "bottom" $margin
  984.             -attachNone $reloadButton "right"
  985.  
  986.             -attachControl snapSeparator "left" $margin $reloadButton
  987.             -attachForm snapSeparator "top" $margin
  988.             -attachForm snapSeparator "bottom" $margin
  989.             -attachNone snapSeparator "right"
  990.  
  991.             -attachControl timeSnapButton "left" $margin snapSeparator
  992.             -attachForm timeSnapButton "top" $margin
  993.             -attachForm timeSnapButton "bottom" $margin
  994.             -attachNone timeSnapButton "right"
  995.  
  996.             -attachControl valueSnapButton "left" 0 timeSnapButton
  997.             -attachForm valueSnapButton "top" $margin
  998.             -attachForm valueSnapButton "bottom" $margin
  999.             -attachNone valueSnapButton "right"
  1000.  
  1001.             -attachControl rightSeparator "left" $margin valueSnapButton
  1002.             -attachForm rightSeparator "top" $margin
  1003.             -attachForm rightSeparator "bottom" $margin
  1004.             -attachNone rightSeparator "right"
  1005.  
  1006.             $widgetList[4];
  1007.  
  1008.     // Add two buttons to $widgetList[5] formLayout to
  1009.     // control the size of the formLayout that holds
  1010.     // the outliner and the graph editor widget
  1011.     //
  1012. //    formLayout -p $widgetList[5] -width $gGraphEdOutlinerWidth $outlineEdForm;
  1013.     formLayout -p $widgetList[5] $outlineEdForm;
  1014.         button -l "<<" 
  1015.             -h 15 -rs false
  1016.             -ann "Decrease outliner size"
  1017.             -command ( "setGraphSize smaller " + $widgetList[5] )
  1018.             graphEdSmallerButton;
  1019.         button -l ">>" 
  1020.             -h 15 -rs false
  1021.             -ann "Increase outliner size"
  1022.             -command ( "setGraphSize bigger " + $widgetList[5] )
  1023.             graphEdBiggerButton;
  1024.         string $outlineEdLayout = addSharedOutlinerEditor ($outlineEdForm, $outlineEd);
  1025.     setParent ..;
  1026.  
  1027.     //    Attach the filter menu to the popup menu
  1028.     //    This has to be done after the outliner has been parented
  1029.     //
  1030.     filterUICreateMenu($outlineEd, ($outlineEd + "Popup"));
  1031.  
  1032.     //    Create an edit field for regular expression filtering in the 
  1033.     //    outliner editor.
  1034.     //
  1035.     string $filterField = filterUICreateField($outlineEd, $outlineEdForm);
  1036.     
  1037.     formLayout -e
  1038.         -af graphEdSmallerButton left 0
  1039.         -ap graphEdSmallerButton right 0 50
  1040.         -af graphEdSmallerButton bottom 0
  1041.         -an graphEdSmallerButton top 
  1042.  
  1043.         -ap graphEdBiggerButton left 0 50
  1044.         -af graphEdBiggerButton right 0
  1045.         -af graphEdBiggerButton bottom 0
  1046.         -an graphEdBiggerButton top 
  1047.  
  1048.         -af $filterField top 0
  1049.         -af $filterField left 0
  1050.         -an $filterField bottom
  1051.         -af $filterField right 0
  1052.         
  1053.         -af $outlineEdLayout left 0
  1054.         -af $outlineEdLayout right 0
  1055.         -ac $outlineEdLayout top 0 $filterField
  1056.         -ac $outlineEdLayout bottom 0 graphEdSmallerButton
  1057.         $outlineEdForm;
  1058.  
  1059.     // Parent the editors to the editor layout
  1060.     //
  1061.     animCurveEditor -edit -parent $widgetList[5] $graphEd;
  1062.  
  1063.     // set initial clipTime state
  1064.     //
  1065.     int $clipTimeOptVar = `optionVar -q graphEditorClipTime`;
  1066.     animCurveEditor -e -clipTime $clipTimeOptVar $graphEd;
  1067.     //    Attach a procedure that will limit the kinds of filters displayed
  1068.     //    in the Dope Sheet's filter menus.
  1069.     //
  1070.     filterUISetRelatedFiltersProcedure($outlineEd, "graphEditorFilterCategories");
  1071.  
  1072.     // Setup the formLayout, $widgetList[5]
  1073.     //
  1074. /*    formLayout -e
  1075.         -af $outlineEdForm left 0
  1076.         -af $outlineEdForm bottom 0
  1077.         -af $outlineEdForm top 0
  1078.         -an $outlineEdForm right
  1079.  
  1080.         -ac $graphEd left 0 $outlineEdForm
  1081.         -af $graphEd top 0
  1082.         -af $graphEd bottom 0
  1083.         -af $graphEd right 0
  1084.         $widgetList[5]; */
  1085.  
  1086.     // Ensure that the rowLayout is the correct size,
  1087.     // based on the optionVar graphEdOutlinerWidth
  1088.     //
  1089.     global int $gGraphEdOutlinerWidth;
  1090.     if( !`optionVar -exists graphEdOutlinerWidth` ) {
  1091.         optionVar -iv graphEdOutlinerWidth 190;
  1092.     } 
  1093.     $gGraphEdOutlinerWidth = `optionVar -q graphEdOutlinerWidth`;
  1094.     rowLayout -e -columnWidth 1 $gGraphEdOutlinerWidth $widgetList[5];
  1095.  
  1096.     // Attach menus to the graph editor and the
  1097.     // outliner editor.  
  1098.     //
  1099.     GraphEditorMenu $graphEd $outlineEd $widgetList;
  1100.  
  1101.     setParent -top;
  1102.  
  1103.     setUITemplate -popTemplate;
  1104.  
  1105. //    Do not use the wait cursor, it causes a problem (crash) when used
  1106. //    in combination with the table widget (key frame stats). (64944)
  1107. // 
  1108. //    waitCursor -state off;
  1109. }
  1110.  
  1111. global proc removeGraphEditor (string $whichPanel)
  1112. //
  1113. //  Description:
  1114. //        Remove the panel from a layout.
  1115. //        Delete controls.
  1116. //
  1117. {
  1118.     string $graphEd = ($whichPanel + "GraphEd");
  1119.     string $outlineEd = ($whichPanel + "OutlineEd");
  1120.  
  1121.     if (`animCurveEditor -exists $graphEd`) {
  1122.         animCurveEditor -edit -unParent $graphEd;
  1123.     }
  1124.     if (`outlinerEditor -exists $outlineEd`) {
  1125.         removeSharedOutlinerEditor $outlineEd;
  1126.     }
  1127.     
  1128.     //    If the graph editor is deleted then we must let the filter ui
  1129.     //    know that the filter menu(s) and filter field are no longer valid
  1130.     //    for this editor.
  1131.     //
  1132.     filterUIRemoveView($outlineEd);
  1133. }
  1134.  
  1135. global proc setGraphSize (string $size, string $rowLayout)
  1136. //
  1137. //
  1138. {
  1139.     global int $gGraphEdOutlinerWidth;
  1140. //    string $outlineEdForm = ($whichPanel + "OutlineEdForm");
  1141.  
  1142.     if( $size == "bigger" ) {
  1143.         if( $gGraphEdOutlinerWidth <= 300 ) {
  1144.             $gGraphEdOutlinerWidth = $gGraphEdOutlinerWidth + 20;
  1145.         }
  1146.     } else {
  1147.         if( $gGraphEdOutlinerWidth >= 200 ) {
  1148.             $gGraphEdOutlinerWidth = $gGraphEdOutlinerWidth - 20;
  1149.         }
  1150.     }
  1151. //    formLayout -e -width $gGraphEdOutlinerWidth $outlineEdForm;
  1152.     rowLayout -e -columnWidth 1 $gGraphEdOutlinerWidth $rowLayout;
  1153.     optionVar -iv graphEdOutlinerWidth $gGraphEdOutlinerWidth;
  1154. }
  1155.  
  1156. global proc deleteGraphEditor (string $whichPanel)
  1157. //
  1158. //  Description:
  1159. //        This proc will delete the contents of the panel, but not
  1160. //        the panel itself.
  1161. //
  1162. //  Note:
  1163. //        We only need to delete editors here.  Other UI will be taken care of
  1164. //        by the remove proc.
  1165. //
  1166. {
  1167.     string $graphEd = ($whichPanel + "GraphEd");
  1168.     string $outlineEd = ($whichPanel + "OutlineEd");
  1169.  
  1170.     if (`animCurveEditor -exists $graphEd`) {
  1171.         deleteUI -editor $graphEd;
  1172.     }
  1173.     if (`outlinerEditor -exists $outlineEd`) {
  1174.         deleteUI -editor $outlineEd;
  1175.     }
  1176. }
  1177.  
  1178. global proc string saveStateGraphEditor (string $whichPanel)
  1179. //
  1180. //  Description:
  1181. //        This proc returns a string that when executed will restore the
  1182. //        current state of the panel elements.
  1183. //
  1184. {
  1185.     string $indent = "\n\t\t\t";
  1186.     string $graphEd = ($whichPanel + "GraphEd");
  1187.     string $outlineEd = ($whichPanel + "OutlineEd");
  1188.  
  1189.     return (
  1190.             $indent + "$editorName = ($panelName+\"OutlineEd\");\n" +
  1191.             `outlinerEditor -query -stateString $outlineEd` + ";\n" +
  1192.             $indent + "$editorName = ($panelName+\"GraphEd\");\n" +
  1193.             `animCurveEditor -query -stateString $graphEd`
  1194.     );
  1195. }
  1196.  
  1197. global proc graphEditorPanel (string $panelName)
  1198. //
  1199. //  Description:
  1200. //        Create a new scripted graphEditor.  If the scripted
  1201. //        panel hasn't yet been defined then define it.
  1202. //
  1203. {
  1204. }
  1205.  
  1206. global proc string [] graphEditorFilterCategories()
  1207. //
  1208. //    Description:
  1209. //        Return the types of filters that the Graph Editor will display
  1210. //        in its "Show->Objects" filter menu.
  1211. //
  1212. {
  1213.     string $result[] = { "Modeling", "Camera", "Animating" };
  1214.     return $result;
  1215. }
  1216.